package cn.niit.letuseatdemo.entity.domain;
import cn.niit.letuseatdemo.entity.groups.AddGroup;
import cn.niit.letuseatdemo.entity.groups.UpdateGroup;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 用户对象 tb_goods
 *
 * @author su_fuming
 * @date 2022-10-15
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Goods extends BaseEntity {

    private static final long serialVersionUID = 1L;
    /** 菜品ID */
    @NotNull(message = "ID不能为空",groups = {UpdateGroup.class})
    private Long goodsId;
//字符串类型变量
    private String search;

    /** 菜品分类 */
    private Long goodsClassifyId;
    private String goodsClassify;

    /**菜品名称  */
    @NotBlank(message = "菜品名称不能为空,请输入!", groups = {AddGroup.class, UpdateGroup.class})
    @Length(min =2, max =10,message = "菜品名称的长度应该在2-10字符之间", groups = {AddGroup.class, UpdateGroup.class})
    private String goodsName;
    /** 菜品价格 */
    private BigDecimal goodsPrice;
    /** 菜品介绍 */
    private String goodsIntroduce;
    /** 菜品状态 */
    private Integer goodsStatus;
    /** 菜品库存 */
    private Long goodsInventory;

    private Long storeId;

    /**菜品图片*/
    private String goodsHeadImage;

    //购物车要买的商品数量
    private  Long goodsNum;
}
